import { IValidator } from "@/controlor/Validator/IValidator";
import { ValidatorResponse } from "@/Types";

export const NoDuplicateValidator: IValidator<string> = function(
  input: string
): ValidatorResponse {
  for (let i = 0; i < input.length - 1; i++) {
    if (input.slice(i + 1).indexOf(input[i]) !== -1) {
      return "输入存在重复字符";
    }
  }
  return true;
};
